import request from '@/utils/request'

/**
 * 获取系统账号列表
 */
export const getQuestionListApi = ({
  difficulty,
  title,
  pageNo,
  pageSize
}) => {
  return request({
    method: 'get',
    url: '/admin/question/list',
    params: {
      difficulty,
      title,
      pageNo,
      pageSize
    }
  })
}
/**
 * 新增题目
 */
export const addQuestionApi = (params = {}) => {
  return request({
    method: 'post',
    url: '/admin/question/add',
    data: params
  })
}
/**
 * 获取题目详情
 */
export const getQuestionDetailApi = (questionId) => {
  return request({
    method: 'get',
    url: '/admin/question/detail',
    params: { questionId }
  })
}
/**
 * 编辑题目
 */
export const editQuestionApi = (params = {}) => {
  return request({
    method: 'put',
    url: '/admin/question/edit',
    data: params
  })
}
/**
 * 删除题目
 */
export const deleteQuestionApi = (questionId) => {
  return request({
    method: 'delete',
    url: '/admin/question/delete',
    params: {
      questionId
    }
  })
}
